<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>修改昵称</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__common.css" />
    <style>
        .aui-bar-nav .aui-iconfont {
            position: relative;
        font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-bar-nav {
            background-color: #fff;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }

        .aui-icon-rightu {
            height: 2.4rem;
            width: 49px;
            background-size: 22px 22px;
            font-size: 0.75rem;
        }
        body{
            background-color: #F5F5F5;
        }
        .name{
            width: 100%;
            height: 2.5rem;
            background-color: #ffffff;
            padding: 0 0.75rem;
            /*line-height: 2.5rem;*/
            font-size:  0.8rem;
        }
        .cha{
            width: 1rem;
            height: 1rem;
            /*line-height: 2.5rem;*/
            margin-top: 0.75rem;
        }
        input[type="text"], input[type="password"] {
            flex: 1;
            color: #010101;
            background: none;
            outline: none;
            font-size: 0.8rem;
            height: 100%;
            /*margin-bottom: 2px;*/
            padding-left: 0;
        }

        input::-webkit-input-placeholder {
            color: #333333;
            font-size: 0.75rem;
            /*line-height: 1.5rem;*/
        }
    </style>
</head>

<body>
<div class="l_box"  id="loading2"><img src="__IMG__loading.gif" alt="" id="loading"></div>

<header class="aui-bar aui-bar-nav underLine" style="padding-top:25px;background-color:#FFFFFF;" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
    <div class="aui-title">修改昵称</div>
    <a class="aui-pull-right">
        <span class="aui-iconfont aui-icon-rightu" tapmode="active" onclick="save()" style="color:#333333;">保存</span>
    </a>
</header>
<div class="name flex-wrap">
    <div class="flex-con"><input type="text" value="小太阳" id="pwd"></div>
    <div class="cha" onclick="cleardata();">
        <img src="__IMG__cha@3x.png" alt="">
    </div>
</div>
<div class="toast-wrap">
    <span class="toast-msg"></span>
</div>
</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>

<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>

<script type="text/javascript" src="__JS__common.js"></script>


<script type="text/javascript">
    // document.getElementById('pwd').value= getUrlParam（location.href）;
    console.log(window.location.search);
    document.getElementById('pwd').value=getUrlParam();
    //右边点击事件
    function right() {
        alert("点击");
    }
    function cleardata() {
        document.getElementById('pwd').value='';

    }
//    保存
    var user_id=55;

    var nicheng=document.getElementById('pwd');
    function save() {
        if (document.getElementById('pwd').value==''){
            toast('请输入内容后保存');
            return ;

        }
        console.log('user_id='+user_id+'&name='+nicheng.value);
        loaddingOpen();
            $.ajax({
            url:'{:url("My/editUser")}',
            data:'user_id='+user_id+'&name='+nicheng.value,//
            type:'POST',
            dataType:'JSON',
            success: function(data){
                loaddingClose();
                if (data.status==200) {
                    toast('保存成功');
                location.href='{:url("My/person_center")}';
                }else {
                    toast(data.msg);
                }

            },
            error: function(xhr, type){
                loaddingClose();

                toast('无网络或连接超时，请重试！');
                // 即使加载出错，也得重置

            }
        });
    }
</script>

</html>
